(function(app){
	
	app.UserInputComponent = 
	ng.core.Component({
		selector:'todo-list',
		template:'<ul>' +
      '<li *ngFor="#todo of todos">' +
      '{{ todo }}' +
      '</li>' +
      '</ul>' +
      '<input #textbox (keyup)="doneTyping($event)">' +
      '<button (click)="addTodo(textbox.value)">Add Todo</button>'
  	})
	.Class({
		constructor:function(){
			this.todos = ["Eat Breakfast", "Walk Dog", "Breathe"];
			this.addTodo = function(todo) {
				this.todos.push(todo);
			};
			this.doneTyping = function($event) {
				if($event.which === 13) {
					this.addTodo($event.target.value);
					$event.target.value = null;
				}
			}
		}
	});
})(window.app || (window.app = {}));

(function(app){
	document.addEventListener('DOMContentLoaded',function(){
		ng.platform.browser.bootstrap(app.UserInputComponent);
	});
})(window.app || (window.app = {}));